import upload from '@/utils/upload'
import request from '@/utils/request'

// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
    const data = {
        oldPassword,
        newPassword
    }
    return request({
        url: '/system/user/profile/updatePwd',
        method: 'put',
        params: data
    })
}
// 查询店铺信息
export function getShopProfile(data) {
    return request({
        url: `/marketers/MarketersApply/list`,
        method: 'post',
        data: data
    })
}

// 删除店铺信息
export function deleteTheShop(shopsId) {
    return request({
        url: `/marketers/MarketersApply/delete/${shopsId}`,
        method: 'delete'
    })
}

// 查询店铺信息
export function getshopDetailProfile(shopsId) {
    return request({
        url: `/marketers/MarketersApply/shopsId/${shopsId}`,
        method: 'get'
    })
}
// 查询商户信息
export function getMarketersProfile(applyId) {
    return request({
        url: `/marketers/apply/${applyId}`,
        method: 'get'
    })
}
// 查询订单信息
export function getOrderDetail(shopsId) {
    return request({
        url: `/order/orderBy/getOrderDetail/${shopsId}`,
        method: 'get'
    })
}
// 查询优惠券信息
export function getCouponProfile(merchantsId) {
    return request({
        url: `/marketers/coupon/coupon/${merchantsId}`,
        method: 'get'
    })
}
// 商家提交信息
export function submitMarketers(data) {
    return request({
        url: '/marketers/apply',
        method: 'post',
        data: data
    })
}
// 店铺提交信息
export function submitshop(data) {
    return request({
        url: '/marketers/MarketersApply/addShop',
        method: 'post',
        data: data
    })
}

// 上传图片
export function uploadAvatar(data) {
    return upload({
        url: '/file/upload',
        name: data.name,
        filePath: data.filePath
    })
}
